package com.bluestarenergy.party.sample.dao;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.bluestarenergy.party.sample.domain.Country;
import com.bluestarenergy.party.sample.domain.Department;
import com.bluestarenergy.party.sample.domain.Hub;
import com.bluestarenergy.party.sample.domain.Person;

@Repository
public class PartyDAOImpl extends BaseDAOHibernate implements PartyDAO{

	@Autowired
	public PartyDAOImpl(SessionFactory sessionFactory) {
		setSessionFactory(sessionFactory);
	}
	
	public List<Person> findPeople() {
		String quey = "from Person";
		return find(Person.class, quey);
	}

	public List<Hub> findHubs() {
		String quey = "from Hubs";
		return find(Hub.class, quey);
	}

	public List<Country> findCountries() {
		String quey = "from Country";
		return find(Country.class, quey);
	}

	public List<Department> findDepartments() {
		String quey = "from Department";
		return find(Department.class, quey);
	}
}
